package com.example.jk.mapper;

import com.example.jk.entity.UserJk;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author cjx
 * @since 2021-04-04
 */
@Mapper
public interface UserJkMapper extends BaseMapper<UserJk> {
    @Select("select * from user_jk where user_id =#{userId} GROUP BY create_time")
    List<UserJk> getList(UserJk userJk);

    @Select("select * from user_jk where user_id =#{userId} and create_time =(select max(create_time) from user_jk where user_id=#{userId})")
    UserJk getMaxTime(UserJk userJk);
    @Select("select * from user_jk where user_id =#{userId}  ORDER BY create_time desc LIMIT 0,#{size} ")
    List<Map<String,Object>> getDayList(UserJk userJk);
}
